﻿<%@ Page Language="c#" 
Buffer="true"
autoeventwireup="true" 
Inherits="Searcharoo.WebApplication.SearchPageBase" 
ContentType="text/xml" 
%><%@ OutputCache Location="None" %><script runat="server">
      // IE8 Visual Search
      // http://blogs.msdn.com/ie/archive/2008/09/18/hello-world-getting-started-with-ie8-visual-search.aspx
      //
      // http://msdn.microsoft.com/en-us/library/cc848862(VS.85).aspx
      //
      // http://msdn.microsoft.com/en-us/library/cc848863.aspx
      protected override SortedList GetSearchResults(Searcharoo.Engine.Search se)
      {
          SortedList sl = se.GetResults(this.SearchQuery, _Catalog, false); // false = ALL results
          foreach (object k in sl.Keys)
          {   // need to escape the output for JSON - otherwise it might break
              // i'm removing all ' and " (just to be safe)
              Searcharoo.Common.ResultFile f = (Searcharoo.Common.ResultFile)sl[k];
              f.Description = f.Description.Replace("'", "").Replace(@"""", "").Replace(@"\", "");
              f.Title = f.Title.Replace("'", "").Replace(@"""", "").Replace(@"\", "");
              f.Url = f.Url.Replace("&", "&amp;");
              //f.KeywordString = f.KeywordString.Replace("'", "").Replace(@"""", "").Replace(@"\", "");

              if (f.Title == "") f.Title = "[no title]";
          }
          return sl;
          
      }
      protected override int MaxResultsPerPage
      {
          get
          {
              return 200; 
          }
      }</script><%@ Register TagPrefix="roo" TagName="SearchPanel" Src="SearchControl.ascx" %><?xml version="1.0" ?>
<SearchSuggestion xmlns ="http://schemas.microsoft.com/Search/2008/suggestions"><asp:Panel runat="server" visible="false"><roo:SearchPanel id="ucSearchPanelHeader" runat="server"  visible="false" IsSearchResultsPage="false" /><asp:Panel id="lblNoSearchResults" visible="false" runat="server"></asp:Panel></asp:Panel>
<Query><%=HttpUtility.HtmlEncode(Request["searchfor"])%></Query>
<Section title="Searcharoo.net OpenSearch">
<Item>
<Text><%=SearchQuery %> has <%=_Geocoded%> geocoded results (and took <%=_DisplayTime%>)</Text>
</Item>
<Separator /> 
		<asp:Repeater id="SearchResults" runat="server"><ItemTemplate>
	    <Item>
            <Text><%# DataBinder.Eval(Container.DataItem, "TitleText") %></Text>
            <Description><%# DataBinder.Eval(Container.DataItem, "KeywordString")%></Description>
            <Url><%# DataBinder.Eval(Container.DataItem, "Url") %></Url>
        </Item></ItemTemplate>
		</asp:Repeater><asp:Panel runat="server" visible="false"><roo:SearchPanel id="ucSearchPanelFooter" runat="server" visible="false" IsSearchResultsPage="true" IsFooter="true"/></asp:Panel>
</Section>
</SearchSuggestion>